home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 2 / Tech Arsenal 2 (Arsenal Computer).iso / clarion / funlib.exe / README.TXT < prev    next >
Encoding:
Text File  |  1994-05-13  |  9.7 KB  |  241 lines

  1.  here are some assorted Functions for calling in programs...
  2. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  3.  DOW - Day of Week. SURPRISE...
  4.        Returns a String of the Day of the Week.
  5.        you may send 2 parameters to the function to determine the
  6.        day of week method of return...
  7.        Omitting the Second parameter automatically returns the Abreviated
  8.        Version.
  9.        Date Field must be LONG
  10.        Return Value must be String
  11.  
  12.        SYNTAX -  Pre:SomeDayString = DOW(Date,'A') ! returns Mon for monday
  13.                  Pre:SomeDayString = DOW(Date,'L') ! returns Monday
  14.                  Pre:SomeDayString = DOW(Date)     ! returns Mon
  15.  
  16. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  17. MOY - Month of year....
  18.       Sometimes it is just the Month name that you want to return.
  19.       this can take two Parameters also.
  20.       DATE - must be Long.
  21.       Type - A for Abreviated , L for long (defaults to A if omitted)
  22.  
  23.       SYNTAX  Pre:SomeMonthString = MOY(DAte,'A') ! returns Jan for January
  24.               Pre:SomeMonthString = MOY(Date,'L') ! returns January
  25.               Pre:SomeMonthString = MOY(Date)     ! returns Jan
  26. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  27. QuarterYear - Quarter of Year
  28.  
  29.    Returns The number of the Quarter that the date falls into
  30.    Since not all Companies or goverment entities use jan 1 as the
  31.    start of the fiscal year a second parameter is available for
  32.    start of fiscal year.
  33.  
  34.    The Function has 2 parameters SearchDate,fiscalDate
  35.  
  36.    SearchDate is the date to be caclulated
  37.    FiscalDate is the start of the Fiscal Year (Optional)
  38.               if fiscal date is ommitted the calculations are based
  39.               on Jan 1 of the same year as sent in Searchdate
  40.  
  41.   Date Fields must be LONG
  42.   Return Value is Short
  43.  
  44.    SYNTAX -  Pre:Quarter = QuarterYear(SearchDate,fiscalDate)
  45.              pre:Quarter = QuarterYear(SearchDate)
  46.  
  47. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  48. DaysEOY - number of days till end of year.
  49.  
  50.    Returns The number of days till End of Year
  51.    The Function has 1 parameters SearchDate
  52.    SearchDate is the date to be caclulated this is optional
  53.               if the searchdate is ommitted the date will default
  54.               to today
  55.  
  56.    Date must be long
  57.    Return value is short
  58.  
  59.  
  60.    SYNTAX  - pre:NumberDays = DaysEoy(Date)
  61.              pre:NumberDays = DaysEoy()
  62.  
  63.  
  64. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  65. DaysBetween - Incusive number of days between dates
  66.  
  67.    Returns The number of days Between dates
  68.    The Function has 2 parameters CalcDate1,DateEnd
  69.    CalcDate is the date to be caclulated
  70.  
  71.    Date2 is the date to be searched to( optional).
  72.          If the date is omitted the date will default to today
  73.  
  74.    Date Fields are LONG
  75.    Return Value is SHORT
  76.  
  77.    SYNTAX -  PRe:NumberDays = DaysBetween(date,date)
  78.              PRe:NumberDays = DaysBetween(date)
  79.  
  80. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  81. SinceBOY - Returns the number of days since the Begining of Year.(Short)
  82.  
  83.    Returns The number of days since the first of the year......
  84.    The Function has 1 parameters CalcDate
  85.    CalcDate is the date to be caclulated if Omitted the date will default
  86.             to today()
  87.  
  88.    Date Field is LONG
  89.    Return value is SHORT
  90.  
  91.    SYNTAX    NumberDays = SinceYear(Date)
  92.  
  93. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  94. CADATE - Returns a string containing the Date Format DD-MMM-YYYY
  95.  
  96.    Returns a Valid Date string for RDB CA type The date format for CA is
  97.    DD-MMM-YYYY
  98.    The Function has 1 parameters ParDate1
  99.    ParDate1 is the date to be Converted
  100.  
  101.    Date Field is LONG
  102.    Return value is STRING
  103.  
  104.    SYNTAX    GoodDate = CaDate(Date)
  105.  
  106. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  107. RDATE- Returns a True or False for validity of date range sent to Function       ║
  108.  
  109.    The Function has 3 parameters ParDate1,ParDate2,ParDate3
  110.  
  111.    ParDate1 is the date to be checked in range
  112.    ParDate2 is the LowRange of date
  113.    ParDate3 is the Highrange date check
  114.  
  115.    Date Fields are LONG
  116.    Return Value is BYTE
  117.  
  118.    SYNTAX    Pre:GoodDate = RDATE(Date,LowDate,HighDate)
  119.  
  120. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  121.  
  122. BDATE - Returns the Next Business date (Monday-Friday)
  123.         Somtimes in Scheduling you need to insure that the Date chosen is
  124.         the next business date.. or even to warn the user that it is not.
  125.         This takes 2 parameters 2nd one is optional and returns a LONG(DAte)
  126.  
  127.         Date - Date to send to function LONG
  128.         Number of days - Variable SHORT or constant (optional)
  129.  
  130.         Returns A LONG
  131.  
  132.         SYNTAX - Pre:SomedateField = Bdate(Date,NoDays)
  133.                  Pre:SomedateField = Bdate(Date)
  134.  
  135.  
  136. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  137. CCalendar - Returns the Date Selected for User.
  138.             This allows you to verify that the date entered is a valid date
  139.             or get the user to choose a valid date.
  140.             Date - Date to start (optional) LONG
  141.  
  142.         SYNTAX - Pre:SomedateField = Ccalendar(Date) !returns a Long
  143.                  Pre:SomedateField = Ccalendar() !returns a Long
  144.  
  145. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  146. Calculator - Calculator function for calculations
  147.              Allows the user or you to pre-send an amount to the calculator
  148.              or call the function to calculate amounts.
  149.              This can take up to 2 parameters
  150.  
  151.              Amount    - Amount to send to Function - REAL
  152.              Precision - Number of Decimal Places (max 6), Short
  153.  
  154.             SYNTAX - Pre:SomeRealField = Calculator()
  155.             SYNTAX - Pre:SomeRealField = Calculator(Amount)
  156.             SYNTAX - Pre:SomeRealField = Calculator(Amount,Places)
  157.  
  158. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  159. MessageBox - Allows a 64k string to be displayed on screen.
  160.              Message box will allow sending of a memo or string field
  161.              to the procedure for information.
  162.              the system allows you to write as much text as necessary and
  163.              will parse it out into 60 char chunks and display it into a
  164.              QUEUE structure.
  165.              This will take two parameters.
  166.  
  167.              Title string - must at least send '' for blank.
  168.              MessageString - 64k max string or memo.
  169.  
  170.              SYNTAX - Messagebox('','this is some string')
  171.              SYNTAX - Messagebox('this is a title','this is some string')
  172.              SYNTAX - Messagebox('this is a title',somestring)
  173.              SYNTAX - Messagebox(TitleString,MemoField)
  174.  
  175. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  176. QUESTIONBOX - Returns the number of the choice selected.(Byte)
  177.  
  178.   Question Box Library
  179.   Allows Message to be sent of any length including Memos
  180.   this is setup to be displayed in an queue array and shown on the Screen
  181.   this function will allow up to 4 prompts for button selections.
  182.  
  183.   SYNTAX - Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice,ButtonChoice,ButtonChoice)
  184.            Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice,ButtonChoice)
  185.            Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice)
  186.            Resultfield = QuestionBox(Title,Message,ButtonChoice)
  187.            Resultfield = QuestionBox(Title,Message)
  188.  
  189.   You may Check the Result of the Question Box in Number format
  190.  
  191.           Execute ResultField
  192.             do Procedure               ! Return 1st Button in Array
  193.             do Procedure               ! Return 2st Button in Array
  194.             do Procedure               ! Return 3st Button in Array
  195.             do Procedure               ! Return 4st Button in Array
  196.             do Procedure               ! Return Exit Button
  197.           End!Execute
  198.        End!If
  199.  
  200.  The Exit Button will be the last choice always... If you send 3 buttons
  201.  and the user exits the result for exit will be 4.
  202.  
  203.  
  204. ═══════════════════════════════════════════════════════════════════════════════════════════════════════
  205.  
  206. to Include this in your System .....
  207.  
  208.     2 Ways....
  209.      In the MAP structure of the Main.Tpl file (Clarion.tpl, or Super.tpl)
  210.      Add in the Include File Just above the %ModuleStructures Line.
  211.  
  212.                    INCLUDE('hLib.Inc')
  213.     Press CTRL_O in your app. press Alt_G In the Global Source Code section
  214.     Access the embed structure for GLOBAL MAP.
  215.     add the Line
  216.  
  217.                    INCLUDE('hLib.Inc')
  218.  
  219.  
  220.     Insure that you have the DLL's in the Clarion3 subdirectory and the LIB's
  221.     in the Clarion3\Lib Directory.
  222.     The Hlib.Inc must be somewhere in the PATH. (Generally place it with the
  223.     DLL's)
  224.  
  225.     When Ready to Process PRess CTRL_P to access the PRoject.
  226.     Access CHANGE PROJECT FILE, MODULES, AND ADD (INSERT),
  227.     %clapfx%hlib.lib , (insure that you check the External obj/lib)
  228.  
  229.    IF confused check how %clapfx%descla21.lib or one of the others and
  230.    Make it match.
  231.  
  232.     Hope you enjoy...
  233.  
  234.     Andy Stapleton <<cowboy>>
  235.     Stallion Systems Consulting
  236.     (405) 794-7997 /Office/Fax
  237.     (405) 794-0832 BBS
  238.  
  239.     CS:ID 75110,2467
  240.  
  241.